function [ nstates ] = getLetterStateNumber( models, letter, index )
    %Returns the number of states in all models or single model (model with given
    %index) for the specific letter
    
    %number of models
    nmodels = size(models,2);
    
    %If index is given
    if nargin~=3
        index = [1:nmodels];
    end
    
    for i = 1 : size(index,2)
        %First set the default N, and then check for exceptions if there is
        %change the value
        j = index(i);
        nstates(j) = models{j}.N;

        nexceptionalLetters = size(models{j}.exceptions,1);
        for el = 1 : nexceptionalLetters
            if letter(1) == models{j}.exceptions{el,1};
                nstates(j) = models{j}.exceptions{el,2};
            end
        end
    end

end

